package Offer;

/**
 * @Author: wangliuyang
 * @Date: 2021/6/9 16:53
 * @Description: 剑指 Offer 10- I. 斐波那契数列
 */
public class Fibonacci {
    public int fib(int n) {
        int a = 0, b = 1, sum = 0;
        for(int i = 0; i < n; i++){
            sum = (a + b) % 1000000007;
            a = b;
            b = sum;
        }
        return a;
    }
}
